package org.jeecg.modules.system.enums;


public enum OrgLevelEnum {
    LEVEL_0(3,""),
    LEVEL_1(6,"1级"),
    LEVEL_2(9,"2级"),
    LEVEL_3(12,"3级"),
    LEVEL_4(15,"4级"),
    LEVEL_5(18,"5级"),
    LEVEL_6(21,"6级"),
    LEVEL_7(24,"7级"),
    LEVEL_8(27,"8级"),

    ;

    private final String level;
    private final int codeLength;


    OrgLevelEnum(int codeLength, String level) {
        this.codeLength = codeLength;
        this.level = level;
    }

    public static String getLevelByCodeLength(int codeLength) {
        for (OrgLevelEnum e : OrgLevelEnum.values()) {
            if (e.codeLength == codeLength) {
                return e.level;
            }
        }
        return "层级未知";
    }
}
